package com.mkb.enums;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author meikb
 * @desc
 * @date 2024-03-20 15:36
 */
@Getter
public enum CaseColorEnum {
    UP_TO_10("#ff00004d", 0.2),
    BETWEEN_10_AND_50("#ff000080", 0.5),
    BETWEEN_50_AND_100("#ff0000c4", 0.7),
    OVER_100("#ff0000", 0.9);

    /**
     * 描述
     */
    private String colorCode;
    private final double fillOpacity;


    CaseColorEnum(String colorCode, double fillOpacity) {
        this.colorCode = colorCode;
        this.fillOpacity = fillOpacity;
    }

    public static CaseColorEnum getRangeForCount(int count) {
        if (count <= 1) {//10
            return UP_TO_10;
        } else if (count <= 2) {//50
            return BETWEEN_10_AND_50;
        } else if (count <= 3) {//100
            return BETWEEN_50_AND_100;
        } else {
            return OVER_100;
        }
    }
}
